#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

class Solution {
public:
    int findContentChildren(vector<int>& g, vector<int>& s) {
        sort(g.begin(),g.end());
        sort(s.begin(),s.end());
        int sum = 0;
        int j = 0;
        for(int i = 0;i<s.size();i++){
            if(s[i]>=g[j]){
                sum+=1;
                j = j+1;
            }
            if(j>=g.size()){
                break;
            }
        }
        return sum;
    }
};